<template>
    <div>
        <div class="banner">
            <img class="banner-img" 
                 :src="bannerImg"
                 @click="handleGalleryClick"> 
           
            <div class="banner-info">
                <div class="banner-title">{{sightName}}</div>
                
                <div class="banner-price">39</div>
            </div>
        </div>
        <fade-animation>
            <common-gallary :gallaryImgs="gallaryImgs"
                            v-show="isShowGallery" 
                            @changeShowState="handleClose"></common-gallary>
        </fade-animation>
    </div>   
</template>

<script>
import CommonGallary from 'common/gallary/Gallary.vue'
import FadeAnimation from 'common/fade/Fade.vue'
export default {
    name:'Banner',
    data(){
        return{
            isShowGallery:false
        }
    },
    props:{
        gallaryImgs:Array,
        sightName:String,
        bannerImg:String,
       
    },
    components:{
        CommonGallary,
        FadeAnimation
    },

    methods:{
        handleGalleryClick(){
            this.isShowGallery=true
        },
        handleClose(){
            this.isShowGallery=false
        }
    }
}
</script>

<style lang="stylus" scoped>
    .banner
        position: relative
        height :0
        padding-bottom :55%
        overflow: hidden
        .banner-img
            width :100%
        .banner-info
            position:absolute
            left :0
            right :0
            bottom :0
            line-height .6rem
            color :#fff
            display:flex
            background-image :linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
            .banner-title
                flex :1
                font-size :.32rem
                padding :0 .2rem
            .banner-price
                padding:0 .4rem
                line-height :.32rem
                height :.32rem
                border-radius :.2rem
                background :rgba(0,0,0,.8)
                font-size :.24rem
                margin-top :.16rem

</style>


